package com.unina.dropplayer.utilities;

import com.dropbox.client2.DropboxAPI;
import com.dropbox.client2.DropboxAPI.Entry;
import com.dropbox.client2.exception.DropboxException;
import com.unina.dropplayer.common.DropPlayerConstants;

public class RootFolderBuilder {
	
	
	
	public static Entry createRootFolder(DropboxAPI<?> mDBApi){
		Entry dropBoxEntry = null;
		try {
			dropBoxEntry = mDBApi.metadata(DropPlayerConstants.DROP_PLAYER_ROOT_FOLDER,  1000, null, true, null);
			if(null == dropBoxEntry){
				dropBoxEntry = mDBApi.createFolder(DropPlayerConstants.DROP_PLAYER_ROOT_FOLDER);
			}
		} catch (DropboxException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return dropBoxEntry;
	}

}
